import { randomString } from '../utils/public'


export default [
  {
    url: '/api/user/login',
    method: 'post',
    body: null,
    //响应数据
    response: (options: any) => {
      let token = randomString(30)
      let { body } = options
      if (body.userName === 'admin' && body.userPass === '123456') {
        return {
          code: 200,
          message: 'success',
          data: {
            data: {
              token: `token_${token}`,
              ...options.body
            }
          }
        }
      } else {
        return {
          code: 0,
          message: '账号密码错误',
        }
      }
    }
  }
]